<script>
  // map
  // 封装实现map循环的代码原理
  function mapList (arr, mapfor) {
let brr = []
for (let index = 0; index < arr.length; index++) {
  let crr = mapfor(arr[index])
  brr.push(crr)
}
  return brr
  }
  let arr = [1,2,3]
  let cb = mapList (arr, (item) => {
return item*2
  })
  // console.log(cb);
</script>